package cn.znzz.cjm.feign;

import cn.znzz.cjm.util.AjaxResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserInfoFallback implements FallbackFactory<IUserInfoFeignClient>{

    @Override
    public IUserInfoFeignClient create(Throwable throwable) {
        return new IUserInfoFeignClient() {
            @Override
            public AjaxResult findUserInfo(Long id) {
                return AjaxResult.me().setMessage("获取用户基本信息异常").setSuccess(false);
            }
        };
    }
}
